package com.platform.utils;

import org.apache.commons.lang.StringUtils;

import java.util.List;
import java.util.Map;

public class PrintMessageUtils {

    public static void traverseMap(Map<String, Object> params) {
        params.forEach((key, value) -> System.out.println("Key: " + key + ", Value: " + value));
    }

    public static void traverseList(List list) {
        for(Object o: list) {
            System.out.println(o.toString());
        }
    }

    public static void traverseListMap(List<Map<String, Object>> data) {
        for (Map<String, Object> map : data) {
            for (Map.Entry<String, Object> entry : map.entrySet()) {
                String key = entry.getKey();
                String value = entry.getValue().toString(); // 强制转换为String
                System.out.println("Key: " + key + ", Value: " + value);
            }
        }
    }
}
